﻿package mortal.game.view.levelReward.cellrender
{
    import com.mui.controls.*;
    import com.mui.utils.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.item.*;
    import mortal.game.view.levelReward.other.*;

    public class LevelRewardVipUpBagGiftCellRender extends GCellRenderer
    {
        private var _giftItem:BaseItem;
        private var _infoTxt:GTextFiled;

        public function LevelRewardVipUpBagGiftCellRender()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._giftItem = UICompomentPool.getUICompoment(BaseItem);
            this._giftItem.x = 0;
            this._giftItem.y = 25;
            this.addChild(this._giftItem);
            this._giftItem.setItemStyle(ItemStyleConst.Small, ImagesConst.PackItemBg, 2, 2);
            this._giftItem.isDragAble = false;
            this._infoTxt = UIFactory.gTextField("", 8 - 5, 8, 40, 20, this, GlobalStyle.textFormatHuang2);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            super.data = param1;
            var _loc_2:* = param1 as LevelRewardGiftBag;
            if (_loc_2 && _loc_2.bag)
            {
                this._giftItem.itemData = new ItemData(_loc_2.bag.code);
                this._infoTxt.text = "Lv." + _loc_2.level;
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._giftItem.dispose(param1);
            this._infoTxt.dispose(param1);
            this._giftItem = null;
            this._infoTxt = null;
            return;
        }// end function

    }
}
